var nodemailer=require('nodemailer');

//配置邮件
var transporter = nodemailer.createTransport({
    host: "smtp.163.com",
    port:465,
    auth: {
        user: 'liyuan520310@163.com',
        pass: 'LIYUAN//563012//',
    },
    secure: true
});

var mailOptions={
    from:"liyuan520310@163.com",
    to:"469819598@qq.com",
    subject : 'nodemailer test mail!',
    text:'邮件内容：<br/>这是来自nodemailer发送的邮件！',
    html:'邮件内容：<br/>这是来自nodemailer发送的邮件！'
}

//调用发送邮件
transporter.sendMail(mailOptions,(err,info)=>{
    if(err)return console.log('err:\n',err);
    console.log('Info:\n',info);
});